<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>测试本地存储</title>
</head>
<body>
    测试开始
    <p id="demo"></p>
    <div id="div1" class="divClass">
        <p>这是第一段</p>
        <form>
            <label for="text1">输入文本：</label>
            <input type="text" id="text1" name="text1" placeholder="请输入文本">
        </form>
    </div>
    测试结束
    <script>
        let myObj, myJSON, text, obj;

        // 存储数据：
        myObj = {"name":"Bill Gates", "age":62, "city":"Seattle"};
        myJSON = JSON.stringify(myObj);
        localStorage.setItem("testJSON", myJSON);
        //取回在数据：
        text = localStorage.getItem("testJSON");
        obj = JSON.parse(text);
        document.getElementById("demo").innerHTML = obj.name
        async function getJSON() {
            let url = window.location.origin + "/result";
               // 'http://localhost:5000/result';
            try {
                let response = await fetch(url);
                return await response.json();
            } catch (error) {
                console.log('Request Failed', error);
            }
        }
        console.log(getJSON());
        console.log("运行完毕")
    </script>

 </body>
</html>
